﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CFSystem.JXC.BasisInfo
{
    using CFSystem.JXC.BLL;
    using CFSystem.JXC.Model;

    public partial class FrmStockMaintenance : Form
    {
        private StockBLL _stockBLL;

        public FrmStockMaintenance()
        {
            InitializeComponent();

            _stockBLL = new StockBLL();

            GenerateDefaultUI();
        }

        private void GenerateDefaultUI()
        {
            cboPeriod.SelectedIndex = 0;
            cboSearchCategory.SelectedIndex = 0;
            txtSearch.Focus();

            dgvStockItems.DataSource = _stockBLL.GetAllStockRecords();
        }

        private void menuAddStock_Click(object sender, EventArgs e)
        {
            FrmStockInfo stockInfo = new FrmStockInfo();
            stockInfo.ShowDialog();
        }

        private void menuUpdateStock_Click(object sender, EventArgs e)
        {
            FrmStockInfo stockInfo = new FrmStockInfo();
            stockInfo.ShowDialog();
        }

        private void menuDelStock_Click(object sender, EventArgs e)
        {

        }
    }
}
